<?php

namespace Viettrans\FrontBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Viettrans\FrontBundle\Entity\Town
 *
 * @ORM\Table(name="town")
 * @ORM\Entity(repositoryClass="Viettrans\FrontBundle\Entity\TownRepository")
 */
class Town
{
/*******************************************************************************
* Begin of user's definitions
*******************************************************************************/
    /**
    * @ORM\OneToMany(targetEntity="User", mappedBy="town")
    */
    protected $users;
	
    /**
    * @ORM\OneToMany(targetEntity="Announcement", mappedBy="town")
    */
    protected $announcements;

    /**
    * @ORM\ManyToOne(targetEntity="Department", inversedBy="towns")
    * @ORM\JoinColumn(name="departmentId", referencedColumnName="id")
    */
    protected $department;
    
/*******************************************************************************
* End of user's definitions
*******************************************************************************/ 
    
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer $departmentId
     *
     * @ORM\Column(name="departmentId", type="integer")
     */
    private $departmentId;

    /**
     * @var integer $code
     *
     * @ORM\Column(name="code", type="integer")
     */
    private $code;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set departmentId
     *
     * @param integer $departmentId
     */
    public function setDepartmentId($departmentId)
    {
        $this->departmentId = $departmentId;
    }

    /**
     * Get departmentId
     *
     * @return integer 
     */
    public function getDepartmentId()
    {
        return $this->departmentId;
    }

    /**
     * Set code
     *
     * @param integer $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * Get code
     *
     * @return integer 
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
}